<?php

namespace common\validate;


class ProjectCapacityReport extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // Fields 验证场景定义
    public function sceneFields()
    {
        return $this;
    }

    // Find 验证场景定义
    public function sceneFind()
    {
        return $this
            ->append("param", "require|array")
            ->append("param.filter", "require|array");
    }

    // Select 验证场景定义
    public function sceneSelect()
    {
        return $this
            ->append("param", "array")
            ->append("param.page", "array");
    }

    // Create 验证场景定义
    public function sceneCreate()
    {
        return $this->append('data.name', 'require|max:128')
            ->append('data.code', 'max:128');
    }

    // Update 验证场景定义
    public function sceneUpdate()
    {
        return $this->append('data.id', 'require')
            ->append('data.name', 'max:128')
            ->append('data.code', 'max:128');
    }

    // Delete 验证场景定义
    public function sceneDelete()
    {
        return $this->append('param.filter', 'require');
    }

    // SelectByStepCategory 验证场景定义
    public function sceneSelectByStepCategory()
    {
        return $this->append('param.project_id', 'require|integer')
            ->append('param.step_category_id_list', 'require|array')
            ->append('param.year', 'require');
    }

    // SaveByStepCategory 验证场景定义
    public function sceneSaveByStepCategory()
    {
        return $this->append('param.project_id', 'require|integer')
            ->append('param.step_category_id_list', 'require|array')
            ->append('param.year_month', 'require')
            ->append('param.config', 'require|array');
    }

    // GetShowStepCategoryList 验证场景定义
    public function sceneGetShowStepCategoryList()
    {
        return $this->append('param.project_id', 'require');
    }

    // SelectPlanRealData 验证场景定义
    public function sceneSelectPlanRealData()
    {
        return $this->append('param.project_id', 'require')
            ->append('param.step_category_id_list', 'require|array')
            ->append('param.start_date', 'require')
            ->append('param.end_date', 'require');
    }

    // UserTaskList 验证场景定义
    public function sceneUserTaskList()
    {
        return $this
            ->append('param.page', 'require')
            ->append('param.filter.task_member_partner', 'require|integer')
            ->append('param.month', 'require')
            ->append('param.step_category_id_list', 'require|array');
    }

    // SelectTaskPlanData 验证场景定义
    public function sceneSelectTaskPlanData()
    {
        return $this->append('param.project_id', 'require')
            ->append('param.step_category_id_list', 'require|array')
            ->append('param.start_date', 'require')
            ->append('param.end_date', 'require')
            ->append('param.department_id', 'require')
            ->append('param.user_id', 'require');
    }

    // GetProjectEntityNumberCountByMonth
    public function sceneGetProjectEntityNumberCountByMonth()
    {
        return $this->append('param.project_id', 'require|array')
            ->append('param.step_category_id_list', 'require|array')
            ->append('param.start_date', 'require')
            ->append('param.end_date', 'require');
    }

    public function sceneGetProjectEntityCountMonthInfo()
    {
        return $this->append('param.project_id', 'require|array')
            ->append('param.step_category_id_list', 'require|array')
            ->append('param.start_date', 'require')
            ->append('param.end_date', 'require');
    }

    public function getProjectEntityNumberAvg()
    {
        return $this->append('param.project_id', 'require|array')
            ->append('param.step_category_id_list', 'require|array');
    }
}
